<!--
  ~ Copyright 2018 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

    <title>Process Documentation - {{process.general.id}}</title>

    <link type="text/css" rel="stylesheet" href="{{&moduleName}}/css/patternfly.min.css" media="print"/>

    <style>
        .categoryCaption {
            padding-left: 5px;
            vertical-align: top;
            display: inline-block;
        }

        .categoryIcon {
            width: 20px;
            display: inline-block;
        }

        .elementIcon {
            width: 20px;
            background: transparent !important;
            vertical-align: top;
        }

        .diagramImage {
            width: 100%;
            height: 100%;
        }

        #diagramImageDiv > svg {
            max-width: 100%;
            max-height: 100%;
        }

        #pagecontainer {
            margin-left: 20px;
        }

        .textContent{
            white-space:pre; /* or pre-wrap if you want wrapping to still work. */
        }

    </style>
</head>
<body>
<div id="pagecontainer">
    <p>
        <p id="pagecontainercore">

        <p>
        <h1 class="page-header" id="process-documentation">Process Documentation</h1>
        </p>

        <h2 id="overview"><span class="badge badge-inverse">1.0</span> Process Overview</h2>

        <p>
        <h3 id="process-info"><span class="badge badge-inverse">1.1</span> General</h3>
        </p>

        <!-- Process info -->
        {{#process}}
        {{#general}}
        <p id="processinfocontent">
        <table class="table table-inverse">
            <tbody class="textContent">
            <tr>
                <td><b>ID</b></td>
                <td>{{id}}</td>
            </tr>
            <tr>
                <td><b>Package</b></td>
                <td>{{pkg}}</td>
            </tr>
            <tr>
                <td><b>Name</b></td>
                <td>{{name}}</td>
            </tr>
            <tr>
                <td><b>Is executable</b></td>
                <td>{{isExecutable}}</td>
            </tr>
            <tr>
                <td><b>Is AdHoc</b></td>
                <td>{{isAdhoc}}</td>
            </tr>
            <tr>
                <td><b>Version</b></td>
                <td>{{version}}</td>
            </tr>
            <tr>
                <td><b>Documentation</b></td>
                <td>{{&documentation}}</td>
            </tr>
            <tr>
                <td><b>Description</b></td>
                <td>{{&description}}</td>
            </tr>
            </tbody>
        </table>
        </p>
        {{/general}}
        <!-- End Process info -->

        <!--Imports -->
        {{#imports}}
        <p>
        <h3 id="process-imports"><span class="badge badge-inverse">1.2</span> Imports</h3></p>

        <p id="importscontent">

            <ul class="list-group" {{noImportsHidden}}>
                <li class="list-group-item">
                    <span class="pull-xs-right">No imports</span>
                </li>
            </ul>

            <table class="table table-inverse" {{importsTableHidden}}>
                <thead>
                    <tr {{importsTableHidden}}>
                        <th width="100%" colspan="2" style="text-align: center">Data Type Imports: {{totalDefaultImports}}</th>
                    </tr>
                    <tr {{defaultImportsHidden}}>
                        <th width="100%" colspan="2">Class Name</th>
                    </tr>
                </thead>
                <tbody {{defaultImportsHidden}}>
                    {{#defaultImports}}
                    <tr>
                        <td colspan="2">{{className}}</td>
                    </tr>
                    {{/defaultImports}}
                </tbody>
                <thead>
                    <tr {{importsTableHidden}}>
                        <th width="100%" colspan="2" style="text-align: center">WSDL Imports: {{totalWSDLImports}}</th>
                    </tr>
                    <tr {{wsdlImportsHidden}}>
                        <th width="50%">Location</th>
                        <th width="50%">Namespace</th>
                    </tr>
                </thead>
                <tbody {{wsdlImportsHidden}}>
                    {{#wsdlImports}}
                    <tr>
                        <td>{{location}}</td>
                        <td>{{namespace}}</td>
                    </tr>
                    {{/wsdlImports}}
                </tbody>
            </table>

        </p>
        {{/imports}}

        <!-- DataTotal -->
        {{#dataTotal}}
        <p id="processTotal">
        <h3 id="process-totals"><span class="badge badge-inverse">1.3</span> Data Totals</h3></p>

        <p id="processdatatotals">
        <ul class="list-group">
            <li class="list-group-item">
                Variables
                <span class="pull-xs-right">{{totalVariables}}</span>
            </li>
        </ul>
        </p>

        <!--Variables -->
        <p>
        <h3 id="process-vars"><span class="badge badge-inverse">1.4</span> Variables</h3></p>

        <p id="processvarcontent">
        <table class="table table-inverse">
            <thead>
            <tr>
                <th width="10%">Name</th>
                <th width="50%">Type</th>
                <th width="40%">KPI</th>

            </tr>
            </thead>
            <tbody>

            {{#tripplets}}
            <tr>
                <td>{{name}}</td>
                <td>{{type}}</td>
                <td>{{kpi}}</td>
            </tr>
            {{/tripplets}}


            </tbody>
        </table>
        </p>

        <!-- End DataTotal -->
        {{/dataTotal}}

        <!-- End Process Overview -->
        {{/process}}


        {{#elementsDetails}}
        <p id="elementsDetails">

        <h2 id="element-details"><span class="badge badge-inverse">2.0</span> Element Details</h2>

        <p>
        <h3 id="element-totals"><span class="badge badge-inverse">2.1</span> Totals</h3>
        </p>

        <p id="processelementtotals">

        <ul class="list-group">
            {{#totals}}
            <li class="list-group-item">
                <span class="categoryIcon">{{&typeIcon}}</span>
                <span class="pull-xs-right categoryCaption">{{type}}</span>
                <span class="pull-xs-right categoryCaption">{{quantity}}</span>
            </li>
            {{/totals}}
        </ul>

        </p>

        <p>
        <h3 id="elemen-info"><span class="badge badge-inverse">2.2</span> Elements</h3>
        </p>

        <p id="processelementdetails">

            {{#totals}}

        <div class="list-group">
				    <span class="list-group-item">
				        <h3 class="list-group-item-heading">{{type}}</h3>
                    </span>
        </div>

        {{#elements}}

        <p class="list-group-item-text">
        <div id="_BFEB21E9-AD01-4F45-9D73-70911579BD72" class="panel panel-default">
            <table class="table table-inverse">

                <thead class="panel-heading">
                <tr>
                    <th class="elementIcon">
                        {{&icon}}
                    </th>
                    <th width="50%">
                        <b>Name:</b> {{name}}
                    </th>
                    <th width="50%">
                        <b>Type:</b> {{title}}
                    </th>
                </tr>
                </thead>

                <thead>
                <tr>
                    <th colspan="2">Property Name</th>
                    <th>Property Value</th>
                </tr>
                </thead>
                <tbody class="textContent">
                {{#properties}}
                <tr>
                    <td colspan="2">{{key}}</td>
                    <td>{{&value}}</td>
                </tr>
                {{/properties}}

                </tbody>
            </table>
        </div>
        </p>
        {{/elements}}
        {{/totals}}

        </p>

        </p>
        {{/elementsDetails}}

        <div id="diagramImageDiv" class="diagramImage">
            <h1 id="process-image"><span class="badge badge-inverse">3.0</span> Process Image</h1>

            {{&diagramImage}}

        </div>
    </div>
</div>

</body>
</html>